<template>
  <div class="feedback-page">
    <h2>留言反馈</h2>
    <form @submit.prevent="submitFeedback">
      <div class="form-item">
        <label>标题</label>
        <input type="text" v-model="form.title" placeholder="请输入反馈标题" required />
      </div>

      <div class="form-item">
        <label>反馈内容</label>
        <textarea v-model="form.content" placeholder="请详细描述您的问题或建议" required></textarea>
      </div>

      <div class="form-item">
        <label>联系方式</label>
        <input type="text" v-model="form.contact" placeholder="邮箱/电话（选填）" />
      </div>

      <button type="submit" class="submit-btn">提交反馈</button>
    </form>
  </div>
</template>

<script>
export default {
  name: 'FeedbackPage',
  data() {
    return {
      form: {
        title: '',
        content: '',
        contact: ''
      }
    }
  },
  methods: {
    submitFeedback() {
      if (!this.form.title || !this.form.content) {
        alert("请填写完整信息");
        return;
      }
      console.log("提交反馈：", this.form);
      alert("反馈提交成功，感谢您的建议！");
      this.form = { title: '', content: '', contact: '' };
    }
  }
}
</script>

<style scoped>
.feedback-page {
  padding: 20px;
  font-family: "微软雅黑", sans-serif;
  background-color: #f9f9f9;
}

h2 {
  font-size: 20px;
  text-align: center;
  margin-bottom: 20px;
  color: #333;
}

form {
  background: #fff;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.05);
}

.form-item {
  margin-bottom: 16px;
}

label {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
  color: #555;
}

input,
textarea {
  width: 100%;
  font-size: 15px;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-sizing: border-box;
}

textarea {
  height: 100px;
  resize: none;
}

.submit-btn {
  width: 100%;
  padding: 12px;
  background-color: #2c3e50;
  color: #fff;
  font-size: 16px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
</style>
